//让图层放大的函数
export async function waxSpecial(element,mul,speed,isShadow) {//参数列表：元素、变化临界值、速度(毫秒),是否需要阴影
  return new Promise((resolve,reject) => {
    if (isShadow) element.style.cssText  = `box-shadow:0px 21px 63px rgba(0,0,0,0.37)`;
    if (mul === 1){
      element.style.transform = `none`;
      if (isShadow) element.style.cssText  = `box-shadow:none`;
      return resolve(true);
    }
    let prototypeMul = 1;
    let timeout = setInterval(() => {
      if (prototypeMul > mul){
        resolve(true);
        clearInterval(timeout);
      }
      prototypeMul += 0.005;
      element.style.transform = `scale(${prototypeMul},${prototypeMul})`;
    },speed)
  })
}

//让图层向上移动的函数
export  async function upMoveSpecial(element,mul,speed){//参数列表：元素、临界值(这里取负数),速度
  return new Promise((resolve,reject) => {
    let  protoTypeMul = 0;
    let timeout = setInterval(() => {
      if (protoTypeMul < mul) {
        resolve(true);
        clearInterval(timeout);
      }
      protoTypeMul -= 0.5;
      element.style.transform = `translate(${0}px,${protoTypeMul}px)`
    },speed)
  })
}

